function showSon(span) {
    if (span.className === "has_children") {
        span.className = "";
        span.nextElementSibling.className = "hide";
    } else {
        var oldSpan = document.querySelector(".has_children");
        if (oldSpan != null) {
            oldSpan.className = "";
            oldSpan.nextElementSibling.className = "hide";
        }
        span.className = "has_children";
        span.nextElementSibling.className = "show";
    }
}

$(function () {
    setUsername();
});

function setUsername() {
    $.ajax({
        url: '/back/manage/getName',
        data: '',
        type: 'get',
        dataType: 'json',
        success: function (data) {
            if (data.username == null) {
                window.open("/back/login.html");
            } else {
                $("#username").html(data.username);
            }
        }
    })
}